xen/pt: Avoid NULL dereference in hvm_pirq_eoi()
authorAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 27 Jun 2017 17:45:03 +0000 (18:45 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Wed, 28 Jun 2017 10:18:40 +0000 (11:18 +0100)
commit34c06658c100414edc7bbbf23e284019facc965e
tree970b1cdcb3d654cdc45edc5ce5c20127c3c66b90
parentca49c64543864d55c114246f48b28d680c821909
xen/pt: Avoid NULL dereference in hvm_pirq_eoi()

Coverity warns that pirq_dpci unconditionally dereferences a NULL pointer.
This warning appears to be triggered by pirq_dpci() which is a hidden ternary
expression.  In reality, it appears that both callers pass a non-NULL pirq
parameter, so the code is ok in practice.

Rearange the logic to fail-safe, which should quiesce Coverity.

Clean up bool_t => bool and trailing whitespace for hvm_domain_use_pirq()
while auditing this area.

No (intended) functional change.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
xen/arch/x86/irq.c
xen/drivers/passthrough/io.c
xen/include/asm-x86/irq.h